import React, { Component } from 'react'
import '../css/redio.scss'
export default class Radio extends Component {
    constructor(props) {
        super(props)
    }
    checked=(index)=>{
       console.log(index,'redio');
        this.props.setcheckedIndex(index)
    }
    render() {
        return (
            <div className='redio'>
                {
                    this.props.data.map((item,index)=>{
                        return(
                            <div key={index} className={this.props.checkedIndex ===index?'item2':'item'} onClick={this.checked.bind(this,index)}>{item}</div>
                        )
                    })
        }
            </div>
        )
    }
}
